/*
 * Copyright (C) 2017-2021
 * All rights reserved, Designed By
 * Copyright authorization contact 18814114118
 */
package com.shop.cereshop.app.dao.recommend;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.app.page.recommend.*;
import com.shop.cereshop.app.param.recommend.RecommendPageDTO;
import com.shop.cereshop.app.param.recommend.RecommendTrendPageParam;
import com.shop.cereshop.commons.domain.recommend.CereRecommendTrends;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface CereRecommendTrendsDAO extends BaseMapper<CereRecommendTrends> {
    List<CereRecommendTrendPageVO> trendPage(RecommendTrendPageParam param);

    CereRecommendTrendDetailVO getTrendById(@Param("recommendId") Long recommendId);

    BusinessShopInfo getPlatformShop(@Param("shopId") Long shopId, @Param("userId") Long userId);

    void addCommentCount(@Param("recommendId") Long recommendId);

    void subCommentCount(@Param("recommendId") Long recommendId, @Param("count") Integer count);

    void addLikesCount(@Param("recommendId") Long recommendId);

    void subLikesCount(@Param("recommendId") Long recommendId);

    void addShareCount(@Param("recommendId") Long recommendId);

    List<RecommendPageVO> getTrendByIds(@Param("param") RecommendPageDTO param, @Param("buyerUserId") Long buyerUserId, @Param("userGeoHash") String userGeoHash);

    List<RecommendPageVO> getBatchByIds(@Param("fileType") Integer fileType, @Param("recommendTypeIds") List<Long> recommendTypeIds, @Param("buyerUserId") Long buyerUserId);

    Set<RecommendPageVO> getCollectAndLike(List<Long> recommendIds, @Param("buyerUserId") Long buyerUserId, @Param("likeType") Integer likeType);

    RecommendPageVO getRecommendDetail(@Param("recommendId") Long recommendId, @Param("buyerUserId") Long buyerUserId);

    void saveRecommend(CereRecommendTrends trends);

    void audit(CereRecommendTrends updateTrends);

    Long getBuyerUserId(Long recommendId);

    List<RecommendPageVO> getTrendByTypeId(Long recommendTypeId);

    List<Long> selectRecommendIds();

    List<RecommendPageVO> selectRecommendCountsBatch(@Param("ids") List<Long> recommendIds, @Param("likeType") Integer likeType);

    void updateCountsBatch(@Param("list") List<RecommendPageVO> recommendPageVOs, @Param("time") String time);

    void cancelAllPinned(Long buyerUserId);

    Integer updatePinned(@Param("recommendId") Long recommendId, @Param("pinned") Boolean pinned, @Param("updateTime") String updateTime, @Param("buyerUserId") Long buyerUserId);

    CereRecommendTrends selectRecommendIdIsExist(Long recommendId);

    List<RecommendPageVO> getMyConcernRecommends(@Param("list") List<Long> list, @Param("buyerUserId") Long buyerUserId, @Param("blockedUserIds") List<Long> blockedUserIds);

    List<RecommendPageVO> getTrendsByTypeIds(@Param("list") List<Long> recommendTypeIds);

    Integer deleDaysLikesCount(@Param("recommendId") Long recommendId);

    Integer addDaysLikesCount(@Param("recommendId") Long recommendId);

    int updateTrendStatus(@Param("recommendId") Long recommendId, @Param("publishStatus") Integer publishStatus, @Param("reviewContent") String reviewContent);
}
